Closed Bug 1700365 Opened 4 years ago Closed 4 years ago

synthesizeNativePointer should convert to right coordinates

Categories

(Testing :: Mochitest, defect)

Unspecified
Android
defect

Tracking

(firefox89 fixed)

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: m_kato, Assigned: m_kato)

References

(Blocks 2 open bugs, Regressed 1 open bug)

Details

Attachments

(3 files)

synthesizeNativePointer (https://searchfox.org/mozilla-central/rev/be906232eedb22c064b78f3806b38964c04f1fbc/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/PanZoomController.java#741) doesn't convert clientX and clientY to right coordinates. I guess that we may have to use getClientToScreenMatrix or getClientToSurfaceMatrix to post right mouse point on mouse event.

Component: General → Mochitest
Product: GeckoView → Testing
OS: All → Android
Blocks: 1587995
Assignee: nobody → m_kato

Hmm, we should use right screen coordinates on SendNativeMouseEvent.

One is screen coordinate issue (bug 1701546). another one is GeckoView's mouse button emulation of SynthesizeNativeMouseEvent.

Button state is current button push state. So when on ButtonUp, this is 0.

We have to consider mobile viewport scale to calculate screen position.
And mozInnerScreen isn't valid position if that scale isn't 1 (bug 1701546).

Also, this function won't work on Fission+xorigin with mobile viewport due to
no way to get current mobile viewport scale since window.top isn't same
origin.

Depends on D110197

This test is often failure on debug build due to zoom to focused input.

Depends on D110198

Attachment #9214582 - Attachment description: Bug 1700365 - Add workaround to disable zoom to focused input. r=masayuki → Bug 1700365 - Add workaround that disables zoom to focused input. r=masayuki
Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/482fec13b96f SynthesizeNativeMouseEvent shouldn't set button state on ButtonUp. r=geckoview-reviewers,agi https://hg.mozilla.org/integration/autoland/rev/5735e7f86a01 synthesizeNativeMouseEvent works on mobile viewport. r=masayuki https://hg.mozilla.org/integration/autoland/rev/72ff67f96a3f Add workaround that disables zoom to focused input. r=masayuki
Regressions: 1704064
See Also: → 1720248

From https://searchfox.org/mozilla-central/rev/ae02905b1c4e7c2e6f974a3cfad24503006110ac/testing/mochitest/tests/SimpleTest/EventUtils.js#1108-1114

  let resolution = 1.0;
  try {
    resolution = _getDOMWindowUtils(win.top).getResolution();
  } catch (e) {
    // XXX How to get mobile viewport scale on Fission+xorigin since
    //     window.top access isn't allowed due to cross-origin?
  }

You can just use SpecialPowers.spawn;

  const resolution = await SpecialPowers.spawn(window.top, [], () => {                
    return SpecialPowers.getDOMWindowUtils(content.window).getResolution();     
  });
See Also: 1720248
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: